import java.util.Scanner;

public class Ex5_19{
	public static void main(String[] args){
		Scanner input = new Scanner(System.in);
		System.out.print("Enter three sides for a triangle: ");
		double s1 = input.nextDouble();
		double s2 = input.nextDouble();
		double s3 = input.nextDouble();
		double a = area(s1, s2, s3);
		if (a == 0)
			System.out.printf("Invalid Triangle.\n");
		else
			System.out.printf("The area of the triangle is: %.2f\n", a);
	}

	public static boolean isValid(double side1, double side2, double side3){
		if (side1 + side2 > side3 ||
			side1 + side3 > side2 ||
			side2 + side3 > side1)
			return true;
		else 
			return false;
	}

	public static double area(double side1, double side2, double side3){
		if (isValid(side1, side2, side3)){
			double s = (side1 + side2 + side3) / 2;
			double a = Math.pow(s*(s-side1)*(s-side2)*(s-side3), 0.5);
			return a;
		}
		else 
			return 0;
	}
}
